﻿//-----------------------------------------------------------------------
// <copyright file="NavigationController.cs" company="deixei.com">
//     Copyright (c) deixei.com. All rights reserved.
// </copyright>
// <author>Marcio Parente</author>
//---------------------------------------------------------------------
namespace Deixei.Domain
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Web.Script.Serialization;

    /// <summary>
    /// Navigation Controller. Sub Menu Item.
    /// </summary>
    public class NavigationController : IDomainEntity, IArchivable, IAuditable
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>
        /// The id.
        /// </value>
        [Key]
        [Display(Name = "Id")]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the area.
        /// </summary>
        /// <value>
        /// The area.
        /// </value>
        [Display(Name = "Area Name", Description = "Area.", ShortName = "Area")]
        [Required(ErrorMessage="Area name is Required.", AllowEmptyStrings= true)]
        public string Area { get; set; }

        /// <summary>
        /// Gets or sets the controller.
        /// </summary>
        /// <value>
        /// The controller.
        /// </value>
        [Required(ErrorMessage = "Controller name is Required.")]
        public string Controller { get; set; }

        /// <summary>
        /// Gets or sets the action.
        /// </summary>
        /// <value>
        /// The action.
        /// </value>
        [Required(ErrorMessage = "Action name is Required.")]
        public string Action { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        [Required(ErrorMessage = "Description is Required.")]
        public string Description { get; set; }

        ////http://msdn.microsoft.com/en-us/library/system.web.script.serialization.scriptignoreattribute.aspx
        /// <summary>
        /// Gets or sets the navigation area.
        /// </summary>
        /// <value>
        /// The navigation area.
        /// </value>
        [ScriptIgnore]
        [Display(Name = "Navigation Area", Description = "Navigation Area.", ShortName = "Nav.Area")]
        public virtual NavigationArea NavigationArea { get; set; }

        /// <summary>
        /// Archivable Region
        /// </summary>
        /// <value>
        /// The deleted by.
        /// </value>
        [Display(Name = "Deleted By", Description = "Username of the user that deleted this item.", ShortName = "Del.By")]
        public string DeletedBy { get; set; }

        /// <summary>
        /// Gets or sets the deleted.
        /// </summary>
        /// <value>
        /// The deleted.
        /// </value>
        [DataType(DataType.DateTime)]
        [Display(Name = "Deleted Date", Description = "Date of when this item was deleted.", ShortName = "Del.Dt")]
        public DateTime? Deleted { get; set; }

        /// <summary>
        /// Auditable Region
        /// </summary>
        /// <value>
        /// The created by.
        /// </value>
        [Display(Name = "Created By", Description = "Username of the user that firts registered this item.", ShortName = "Crt.By")]
        public string CreatedBy { get; set; }

        /// <summary>
        /// Gets or sets the created.
        /// </summary>
        /// <value>
        /// The created.
        /// </value>
        [DataType(DataType.DateTime)]
        [Display(Name = "Created Date", Description = "Date of when this item was firts registered.", ShortName = "Crt.Dt")]
        public DateTime Created { get; set; }

        /// <summary>
        /// Gets or sets the updated by.
        /// </summary>
        /// <value>
        /// The updated by.
        /// </value>
        [Display(Name = "Updated By", Description = "Username of the user that last changed this item.", ShortName = "Upd.By")]
        public string UpdatedBy { get; set; }

        /// <summary>
        /// Gets or sets the updated.
        /// </summary>
        /// <value>
        /// The updated.
        /// </value>
        [DataType(DataType.DateTime)]
        [Display(Name = "Updated Date", Description = "Date of when this item was last changed.", ShortName = "Upd.Dt")]
        public DateTime? Updated { get; set; }
    }
}
